package com.his.admin.controller;

import com.his.admin.service.ScheduleService;
import com.his.dao.domain.dto.ListDto;
import com.his.dao.domain.dto.ScheduleDto;
import com.his.dao.domain.entity.Schedule;
import com.his.dao.mapper.ScheduleMapper;
import com.his.util.annotation.RequiresLogin;
import com.his.util.annotation.RequiresPermissions;
import com.his.util.result.RestResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/schedule")
@AllArgsConstructor
@Api(value = "排班模块")
public class ScheduleController {
    private ScheduleService scheduleService;

    @RequiresLogin
    @RequiresPermissions
    @RequestMapping("/all")
    @ApiOperation(value = "获取排班列表",notes = "获取排班列表")
    public RestResult all(@RequestBody ListDto listDto) {
        return scheduleService.all(listDto);
    }

    @RequiresLogin
    @RequiresPermissions
    @RequestMapping("/schedule")
    @ApiOperation(value = "排班",notes = "排班")
    public RestResult schedule(@RequestBody ScheduleDto scheduleDto) {
        return scheduleService.schedule(scheduleDto);
    }
}